﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<skags.Models.TimelineMeasurementsViewModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Tímalína / mælingar
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<div id="navigation">
<% Html.RenderPartial("IndexNavigation"); %>
</div>
<div id="content">
    <p>Hér getur þú eytt og gert nýja atburði og mælingar (sjá neðst)</p>
    <h2>Tímalínan</h2>
      <table>
        <tr>
            <td><a href="AddToTimeline"><img src="../../Content/icons/create.png" alt="Nýtt" /></a></td>
            <th>
                Barn
            </th>
            <th>
                Atburður
            </th>
            <th>
                Dags
            </th>
        </tr>

    <% foreach (var item in Model.Timelines) {%>
    
        <tr>
            <td>
                <a href="DeleteTimeline/<%= item.ID %>" onclick="return confirm('Ertu viss um að þú viljir eyða þessu?')"><img src="../../Content/icons/delete.png" alt="Eyða" /></a>
                
            </td>
            <td>
                <%: item.ChildName %>

            </td>
            <td>
                <%: item.OtherInfo %>
            </td>
            <td>
                <%: (item.LineDate).ToShortDateString()%>
            </td>
        </tr>
    
    <% } %>

    </table>
      <h2>Mælingar</h2>
      <table>
        <tr>
            <td><a href="/Profile/AddMeasurements"><img src="../../Content/icons/create.png" alt="Nýtt" /></a></td>
            <th>
                Barn
            </th>
            <th>
                Hæð
            </th>
            <th>
                Þyngd
            </th>
            <th>
                Dags
            </th>
        </tr>

    <% foreach (var item in Model.Measurements) { %>
        
        <tr>
            <td>
                <a href="DeleteTimeline/<%= item.ID %>" onclick="return confirm('Ertu viss um að þú viljir eyða þessu?')"><img src="../../Content/icons/delete.png" alt="Eyða" /></a>
          
            </td>
            <td>
                <%: item.ChildName %>
            </td>
            <td>
                <%: item.CHeight %>
            </td>
            <td>
                <%: item.CWeight %>
            </td>
            <td>
                <%: (item.LineDate).ToShortDateString() %>
            </td>
        </tr>
    
    <% } %>

    </table>
    </div>

</asp:Content>
